import request from "@/utils/request";

// 获得门店班次管理表。分页
export function getStoreWorksPage(query) {
  return request({
    url: "/store/shift/page",
    method: "get",
    params: query,
  });
}

// 班次管理-添加班次
export function createShift(data) {
  return request({
    url: "/store/shift/create",
    method: "POST",
    data: data,
  });
}

// 获得门店班次管理信息
export function getStoreWorksInfo(query) {
  return request({
    url: "/store/shift/get",
    method: "get",
    params: query,
  });
}

// 班次管理-编辑
export function UpdateStoreWorks(data) {
  return request({
    url: "/store/shift/update",
    method: "put",
    data: data,
  });
}

// 班次管理-开启关闭功能
export function updateCloseState(data) {
  return request({
    url: "/store/shift/updateCloseState",
    method: "POST",
    params: data,
  });
}

// 班次管理-删除
export function DeleteWorks(data) {
  return request({
    url: "/store/shift/delete",
    method: "delete",
    params: data,
  });
}

// 获得指定月份排班记录
export function getShiftRecordMonth(query) {
  return request({
    url: "/store/shift-record/getShiftRecordMonth",
    method: "get",
    params: query,
  });
}

// 生成排班
export function createShiftRecords(data) {
  return request({
    url: "/store/shift-record/create",
    method: "POST",
    data: data,
  });
}

// 编辑排班列表
export function updateList(data) {
    return request({
      url: "/store/shift-record/updateList",
      method: "put",
      data: data,
    });
  }